home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual dBase Pro v7.0 / DATA1.CAB / Sample_dBASE / Mugs / Ireport.wfm < prev    next >
Encoding:
Text File  |  1997-11-20  |  4.0 KB  |  168 lines

  1. //--------------------------------------------------------------
  2. //
  3. //  IReport.wfm - Invoice Request form for 
  4. //  the Mugs Sample Application
  5. //
  6. //  This form provides a spinbox for selecting a invoice
  7. //  number. The readModal() method is overwritten to 
  8. //  set range properties on the spinbox prior to opening
  9. //  the form as a dialog. 
  10. //
  11. //  The DMCONNECT datamodule provides a database connection
  12. //  so this form can create temporary queries using the
  13. //  Invoice table. The temporary queries return the minimum
  14. //  and maximum Invoice values.
  15. //  
  16. //  Dependencies: DMCONNECT.DMD
  17. //                Invoice table
  18. //     
  19. //  Visual dBASE Samples Group
  20. //
  21. //  $Revision:   1.3  $
  22. //
  23. //  Copyright (c) 1997, Borland International, Inc. 
  24. //  All rights reserved.
  25. //
  26. //---------------------------------------------------------------
  27.  
  28. SET TALK OFF
  29. ** END HEADER -- do not remove this line
  30. //
  31. // Generated on 10/23/97
  32. //
  33. parameter bModal
  34. local f
  35. f = new IReportForm()
  36. if (bModal)
  37.    f.mdi = false // ensure not MDI
  38.    f.readModal()
  39. else
  40.    f.open()
  41. endif
  42.  
  43. class IReportForm of FORM
  44.    with (this)
  45.       onOpen = class::FORM_ONOPEN
  46.       readModal = class::FORM_READMODAL
  47.       scaleFontSize = 8
  48.       scaleFontBold = false
  49.       height = 7.0455
  50.       left = 46.5
  51.       top = 0
  52.       width = 42
  53.       text = "Invoice Report"
  54.       autoCenter = true
  55.    endwith
  56.  
  57.  
  58.    this.DMCONNECT = new DATAMODREF()
  59.    this.DMCONNECT.parent = this
  60.    with (this.DMCONNECT)
  61.       filename = "connect.dmd"
  62.       dataModClass = "ConnectDataModule"
  63.       share = 0
  64.       active = true
  65.       left = 0
  66.       top = 0
  67.    endwith
  68.  
  69.  
  70.    this.SPININVOICE = new SPINBOX(this)
  71.    with (this.SPININVOICE)
  72.       height = 1
  73.       left = 24
  74.       top = 1.8947
  75.       width = 12
  76.       metric = 0
  77.       colorHighLight = ""
  78.       rangeMax = 100
  79.       rangeMin = 1
  80.       fontName = "MS Sans Serif"
  81.       fontSize = 8
  82.       value = 1
  83.       borderStyle = 7
  84.    endwith
  85.  
  86.  
  87.    this.TEXT1 = new TEXT(this)
  88.    with (this.TEXT1)
  89.       height = 1
  90.       left = 6
  91.       top = 1.8947
  92.       width = 16
  93.       metric = 0
  94.       colorNormal = "BtnText"
  95.       alignVertical = 1
  96.       fontName = "MS Sans Serif"
  97.       fontSize = 8
  98.       text = "Invoice to print:"
  99.    endwith
  100.  
  101.  
  102.    this.BUTTONOK = new PUSHBUTTON(this)
  103.    with (this.BUTTONOK)
  104.       onClick = {;this.form.OK := true;return this.form.close()}
  105.       height = 1.2105
  106.       left = 7
  107.       top = 4.2632
  108.       width = 12
  109.       text = "OK"
  110.       metric = 0
  111.       fontName = "MS Sans Serif"
  112.       fontSize = 8
  113.       group = true
  114.       colorNormal = "BtnText/BtnFace"
  115.       value = false
  116.    endwith
  117.  
  118.  
  119.    this.BUTTONCANCEL = new PUSHBUTTON(this)
  120.    with (this.BUTTONCANCEL)
  121.       onClick = {||this.form.close()}
  122.       height = 1.2105
  123.       left = 22
  124.       top = 4.2632
  125.       width = 12
  126.       text = "Cancel"
  127.       metric = 0
  128.       fontName = "MS Sans Serif"
  129.       fontSize = 8
  130.       group = true
  131.       colorNormal = "BtnText/BtnFace"
  132.       value = false
  133.    endwith
  134.  
  135.  
  136.    // {Linked Method} form.onOpen
  137.    function form_onOpen
  138.       this.OK = false // create OK property
  139.    return true
  140.  
  141.    // {Linked Method} form.readModal
  142.    function form_readModal
  143.       local q, nMax, nMin
  144.       q = new Query()
  145.       nMin = 0
  146.       nMax = 0
  147.       with (q)
  148.          database := this.dmConnect.ref.dbMugs
  149.          sql      := 'select max(invoice."Invoice ID") from "invoice.dbf" invoice'
  150.          active   := true
  151.       endwith
  152.       nMax := q.rowset.fields[1].value
  153.       q.active := false
  154.       with (q)
  155.          database := this.dmConnect.ref.dbMugs
  156.          sql      := 'select min(invoice."Invoice ID") from "invoice.dbf" invoice'
  157.          active   := true
  158.       endwith
  159.       nMin := q.rowset.fields[1].value
  160.       q.active := false
  161.       with ( this.spinInvoice )
  162.          rangeMin := nMin
  163.          rangeMax := nMax
  164.          rangeRequired := true
  165.       endwith
  166.    return IREPORTFORM::readModal()
  167. endclass
  168.